/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"36EE6B62-A747-486D-BCB0-0235E5905E2E"}
 */
function responder(event) {
	databaseManager.setAutoSave(false)
	temas_to_respuestas.newRecord(false)
	forms.respuestas_alta.controller.loadRecords(temas_to_respuestas)
	application.showFormInDialog(forms.respuestas_alta,-1,-1,-1,-1,'Responder',false,false,'RESP',true)
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"AE824B22-9300-4CE2-9688-CCB6EF42E7E8"}
 */
function cerrar(event) {
	estado = 2
	configBotones()
}

/**
 * @properties={typeid:24,uuid:"034F7D0B-4527-4911-B117-EA4CEA35961A"}
 */
function configBotones()
{
	if (estado == 1)
	{
		elements.btn_responder.enabled = true
		if (supervisor_id == globals.gUsuario)
			elements.btn_cerrar.visible = true
		else
			elements.btn_cerrar.visible = false
	}
	else
	{
		elements.btn_responder.enabled 	= false
		elements.btn_cerrar.visible 	= false
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"C160DEFD-5FA5-4DD1-95C7-9359A32F3D94"}
 */
function volver(event) {
	forms.temas_tbl.controller.show()
}

/**
 * Handle record selected.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"F0C0B887-FC9A-411E-8B92-460A4FA4A3EA"}
 */
function onRecordSelection(event) {
	configBotones()
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"8746BA66-B270-4D6A-B492-35044C72550D"}
 */
function onShow(firstShow, event) {
	if (application.getApplicationType() == APPLICATION_TYPES.WEB_CLIENT)
	{
		elements.tabs_420.tabIndex = 2
	}
	else
	{
		elements.tabs_420.tabIndex = 1
	}
}
